<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='楼宇管理-编辑',jsPaths='/static/js/baseinfo/building/add.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                      <a href="/organization">系统管理</a>
                    <a href="/building">楼宇管理</a>
                    <a><cite>编辑</cite></a>
                </span>
    </div>

    <!--主体内容区-->
    <div class="form-content layui-container">
        <form class="layui-form" th:action="@{/building/update}" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label must">楼宇名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" th:value="${building.name}" maxlength="30"  lay-verify="required" placeholder="请输入楼宇名称" autocomplete="off" class="layui-input">
                    <input type="hidden" name="id" th:value="${building.id}">
                </div>
            </div>
<!--            <div class="layui-form-item">
                <label class="layui-form-label">楼宇功能</label>
                <div class="layui-input-block">
                    <input type="text" name="function" th:value="${building.function}"  maxlength="100" placeholder="请输入楼宇功能" autocomplete="off" class="layui-input">
                </div>
            </div>-->
            <div class="layui-row">
                <div class="layui-col-md4">
                    <div class="layui-form-item">
                        <label class="layui-form-label must">楼宇层数</label>
                        <div class="layui-input-inline">
                            <input type="number" name="floors" th:value="${building.floors}"  lay-verify="required" oninput="if (value.length>2){ value=value.slice(0,2)}else if (value.length==0){value=0} " min="1" max="35" value="0" placeholder="请输入楼宇层数" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-col-md4">
                    <div class="layui-form-item">
                        <label class="layui-form-label">建筑面积</label>
                        <div class="layui-input-inline">
                            <input type="number" name="area"  th:value="${building.area}"  oninput="if (value.length>10){ value=value.slice(0,10)}else if (value.length==0){value=0} " min="0" value="0"  placeholder="请输入楼宇总面积" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">m<sup>2</sup></div>
                    </div>
                </div>
                <div class="layui-col-md4">
                    <div class="layui-form-item">
                        <label class="layui-form-label">投资规模</label>
                        <div class="layui-input-inline">
                            <input type="number" name="cost" th:value="${building.cost}"   oninput="if (value.length>10){ value=value.slice(0,10)}else if (value.length==0){value=0} " min="0" value="0" placeholder="请输入投入资金" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">万元</div>
                    </div>
                </div>
            </div>

<!--            <div class="layui-form-item">
                <label class="layui-form-label">开建时间</label>
                <div class="layui-input-block">
                    <input type="text" name="buildDate" th:value="${#dates.format(building.buildDate,'yyyy-MM-dd')}"  id="buildDate" readonly placeholder="请输入开始建设时间" autocomplete="off" class="layui-input">
                </div>
            </div>-->
            <div class="layui-form-item">
                <label class="layui-form-label">投用时间</label>
                <div class="layui-input-block">
                    <input type="text" name="useDate" th:value="${#dates.format(building.useDate,'yyyy-MM-dd')}" id="useDate" readonly placeholder="请输入投入使用时间" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">建筑材质</label>
                <div class="layui-input-block">
                    <select name="texture" >
                        <option value="0"></option>
                        <option value="1" th:selected="${building.texture == 1}">钢架结构</option>
                        <option value="2" th:selected="${building.texture == 2}">砖混结构</option>
                        <option value="3" th:selected="${building.texture == 3}">简易房</option>
                        <option value="4" th:selected="${building.texture == 4}">土木机构</option>
                        <option value="5" th:selected="${building.texture == 5}">彩钢板</option>
                        <option value="6" th:selected="${building.texture == 6}">其它</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">建设属性</label>
                <div class="layui-input-block">
                    <select name="property" >
                        <option value="0"></option>
                        <option value="1"  th:selected="${building.property == 1}">新建</option>
                        <option value="2"  th:selected="${building.property == 2}">改建</option>
                        <option value="3"  th:selected="${building.property == 3}">扩建</option>
                        <option value="4"  th:selected="${building.property == 4}">租用</option>
                    </select>
                </div>
            </div>
<!--            <div class="layui-form-item">
                <label class="layui-form-label">建筑类型</label>
                <div class="layui-input-block">
                    <select name="type">
                        <option value="0"></option>
                        <option value="1"  th:selected="${building.type == 1}">住院楼</option>
                        <option value="2"  th:selected="${building.type == 2}">其它</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label must">建筑状态</label>
                <div class="layui-input-block">
                    <select name="status" lay-verify="required">
                        <option value=""></option>
                        <option value="1" th:selected="${building.status == 1}">投用</option>
                        <option value="2" th:selected="${building.status == 2}">在建</option>
                    </select>
                </div>
            </div>-->
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
                    <a href="/building" class="layui-btn layui-btn-primary">返回</a>
                </div>
            </div>
        </form>

    </div>
</div>
</html>